═══ 1. Introduction ═══ PMJPEG is a shareware image viewer with image processing and conversion capabilities for OS/2 2.x. PMJPEG is a port of WinJPEG to OS/2 2.x. PMJPEG v.1.40 has the following features: ■ display JPEG, GIF, TIFF, Targa, PCX, Windows BMP, or OS/2 BMP images ■ export an image to JPEG, GIF, TIFF, Targa, PCX, Windows BMP, or OS/2 BMP images ■ capability of generating OS/2 desktop-background bitmaps that use the system colors ■ display an image in 16 color, 256 color, or truecolor display modes ■ print an image with scaling, best proportional fit on the page, or fit for full page ■ red/green/blue or hue/saturation/brightness adjustment ■ contrast enhancement ■ gamma correction ■ image rotation, vertical or horizontal flip, and image resizing ■ image cropping ■ batch file compression of GIF, TIFF, or Targa files to JPEG File Interchange Format ■ copy an image to the clipboard or paste an image from the clipboard ■ slideshow: display selected files sequentially with a cycle option ■ image buffering in a cyclic slideshow ■ support for file name extension association and starting a slideshow from the command line ═══ 2. Known Problems ═══ There are two bugs in the 256 color ET4000 driver that comes with the OS/2 2.1 beta or OS/2 2.0 + Service Pack: 1) the driver does not stretch the bitmap correctly so the Stretch to Fit Window option does not work properly, and 2) the image under the dialog box or under the drop-down menu is not re-drawn with the right colors. Use the Auto-Refresh option if you have the second problem. If you are using the 256 color ET4000 driver, for certain images such as 24-bit images displayed with Maximum Color Depth set to 256 colors, the text that shows the cropping dimensions is garbled by a filled box. This appears to be a bug in OS/2's palette manager or the driver. If you are using a 256 color driver, when you exit PMJPEG, the system colors do not immediately return to normal. The system colors are gradually restored by OS/2. You can force the colors to change back by opening and/or closing a window, such as the window list that pops up when you hit CTL-ESC. ═══ 3. JPEG ═══ Joint Photographic Experts Group (JPEG) refers to a still-picture compression standard that specifies several modes of operation. The mode used by the Independent JPEG Group's(IJPEG) software, which is incorporated into PMJPEG, is sequential buildup; in this mode, each component of an image is encoded in a left-to-right and top-to-bottom scan. Sequential mode is lossy, which means that when you compress an image, you will lose information. That is, when you decode the compressed image, the decoded image will not exactly match the original. One reason that sequential mode JPEG is lossy is that the algorithm compresses an image by removing visually insignificant information, colors that the human eye cannot detect. ═══ 4. Converting File Formats with PMJPEG ═══ Images can be converted from one file format to another by loading an image with the File Open menu item and saving it to the desired file format with the File Save menu item. Before you load an image that you want to convert, you should check the Maximum Color Depth option. This option determines the maximum number of colors in a displayed image. Even though an image may look good, there may have been a loss of colors and data in the image. For example, suppose you are viewing a 24-bit image with Maximum Color Depth set to 256 colors. The 24-bit image can have up to 16.7 million colors but the number of colors in the image is reduced to 256 when it is loaded. When you save this image to a different format, you lose many colors that were in the original image. To avoid losing colors in the image, you should set Maximum Color Depth to 16.7 million colors before loading the image. PMJPEG saves a displayed image to a specified file format with 8-bits per pixel or 24-bits per pixel. Images stored with 1, 2, or 4-bits per pixel are converted to 8-bits per pixel and can be saved in this format only. Images with 8 or 24-bits per pixel are saved with 8 or 24-bits per pixel, respectively. The two exceptions to the color depth of the saved file format are the JPEG file format which is always 24-bits per pixel and the GIF format which is 8-bits per pixel. Batch Compression of images to JPEG is not affected by the Maximum Color Depth option. If you are creating a bitmap to be used as an OS/2 desktop-background image, apply the Map to System Colors function to a displayed image before saving it to an OS/2 BMP file. If you are converting a 24-bit image to an OS/2 BMP, you should set Maximum Color Depth to 16.7 million colors before you load the image. This produces a better looking background image than one created by loading a 24-bit image with a Maximum Color Depth of 256 colors and then applying the Map to System Colors function. ═══ 5. Starting a Slideshow from the Command Line ═══ A slideshow can be initiated from the OS/2 command line by executing the following at the OS/2 prompt: pmjpeg [filename 1] [filename 2] [filename 3] ... [filename n] The files are displayed in the order in which they are entered on the command line. Also, the slideshow options that were saved by the Save All Options menu item are used. If no options were saved, the default slideshow options are used. There is no limit to the number of files that you enter. The only restrictions are the number of characters that you can fit in one command at the OS/2 prompt. For example, if you wanted to display the files, "colrtest.jpg", "mirri3.jpg", and "image1.gif", in the order listed , type pmjpeg colrtest.jpg mirri3.jpg image1.gif This example assumes that PMJPEG is in your search path and this command is executed in the directory containing the images. If OS/2 can't find "pmjpeg.exe" or the images, you can prefix "pmjpeg.exe" or the images with a standard OS/2 path. ═══ 6. Image File Formats ═══ o JPEG File Formats o TIFF o Graphics Interchange Format (GIF) o Targa o PCX o BMP ═══ 6.1. JPEG File Formats ═══ The JPEG committee has not specified a standard file format, and consequently, many applications of the JPEG algorithm use their own proprietary format. PMJPEG uses the JPEG File Interchange Format(JFIF) which transports only pixel information. JFIF is supported by the IJPEG Group's software and other programs based on their code. Handmade Software's GIF2JPG and Image Alchemy use a proprietary JPEG format that is not compatible with the JFIF standard. This proprietary format is not supported by PMJPEG. When you use GIF2JPG v.2.0, remember to leave out the "-s" option to produce a JPEG file that is compatible with the JFIF standard and viewable with PMJPEG. ═══ 6.2. Graphics Interchange Format (GIF) ═══ PMJPEG can view interlaced/non-interlaced GIF87a and GIF89a files, and it can save non-interlaced GIF87a files. If a GIF89a file contains more than one image, it will display the first image in the file. ═══ 6.3. Targa ═══ PMJPEG can view uncompressed or run-length encoded TARGA files stored with 8, 15, 16, 24, or 32 bits per pixel and it can save uncompressed TARGA files with 8 or 24 bits per pixel. ═══ 6.4. PCX ═══ PMJPEG can view PCX files stored with 1, 4, 8, or 24 bits per pixel. If a 1, 4, or 8 bits per pixel PCX file does not have a valid palette, PMJPEG will use a default palette. It can save PCX Version 5.0 files with 8 or 24 bits per pixel. ═══ 6.5. BMP ═══ PMJPEG can view Windows and OS/2 (1.x and 2.0) BMP files stored with 1, 4, 8, or 24 bits per pixel and can view BMP files that are run-length encoded(RLE). In addition, it can display the first image in an OS/2 bitmap array. It can save uncompressed Windows or OS/2 BMP files in 8 or 24 bits per pixel and can save BMP files with RLE. Note that some graphics viewers use the file extension ".RLE" for run-length encoded Windows BMP files. PMJPEG uses the ".BMP" extension as a default for such files. ═══ 6.6. Tagged Interchange File Format (TIFF) ═══ PMJPEG supports a subset of the TIFF 6.0 specification. PMJPEG can view TIFF files stored with 1, 2, 4, 8, or 24 bits per pixel. PMJPEG can read TIFF images stored in strip format, in which the image is divided into horizontal strips of pixels, and tile format, in which an image is divided into rectangular grids of pixels. The compression modes LZW, Packbits, Thunderscan, NeXT, and CCITT (RLE, RLEW, FAX3, FAX4) can be read as well as uncompressed TIFF images. PMJPEG can save uncompressed or LZW compressed TIFF files with 8 or 24 bits per pixel. TIFF files are saved in strip format. ═══ 7. Menu Commands ═══ The menus are ordered by the following main topics: o File Menu o Edit Menu o Options ═══ 7.1. File Menu ═══ The File menu includes commands that enable you to open and save files, to batch convert files to JPEG, and to display multiple images in a selected order. o Open o Save o Save All Options o Delete o Batch Compression o Slideshow o Print o Print Setup o Print Options o Exit ═══ 7.1.1. File Open ═══ Select a file to display. The list boxes in the left column display the drives and the directories in the current path, and the list box in the right column displays the files in the current path. To display a file, click on a file from the file list and press "OK," or double click on the desired file. ═══ 7.1.2. File Save ═══ Select a file name to save the currently displayed image. The list boxes in the left column display the drives and the directories in the current path, and the list box in the right column displays the files in the current path. ═══ 7.1.3. Save All Options ═══ This will save all the PMJPEG options to a file named "pmjpeg.sav" in the same directory as the PMJPEG executable. When PMJPEG is initially loaded, the options will be loaded if "pmjpeg.sav" exists. ═══ 7.1.4. Delete ═══ This menu command lets you delete the file containing the currently displayed image. PMJPEG will prompt you for confirmation before deleting the file. ═══ 7.1.5. Batch Compression ═══ Select GIF, TIFF, and TARGA files to compress to JPEG format with the options specified in the JPEG Options dialog. The list boxes in the left column display the drives and the directories in the current path, the list box in the middle displays the files in the current path, and the one in the right displays a list of files to be converted. To add file(s) to the "Files Selected" box, select the file(s) you want to convert and press the "Add" button. To remove file(s) from this box, select the file(s) in this box and press the "Remove" button. The output file(s) will have the same name as the input file(s) except that they will have a ".jpg" extension. Also, the output file(s) will be placed in the same directory path in which the input file(s) were located. See also JPEG Options. ═══ 7.1.6. Slideshow ═══ Select the JPEG, TIFF, GIF, Targa, and BMP files to display in a slideshow. The order in which you add the files will be the order in which they are displayed. After a picture is loaded and displayed, if Automatic Slide Advancement is selected, there will be a user-selected delay before the next picture is loaded. To advance to the next picture before the delay has elapsed, click on the window with the right mouse button. If Manual Slide Advancement is selected, PMJPEG will wait until you click with the right mouse button before advancing to the next picture. If you would like the slideshow to continue from the beginning of the list after the last picture is displayed, check off the Cycle Slideshow menu option. To abort the slideshow, click on the window with the left mouse button, click on the "Yes" button in the confirmation dialog, and the slideshow will stop after the currently loading picture is displayed. See also Slideshow Options. ═══ 7.1.7. Print ═══ Print the image currently displayed. ═══ 7.1.8. Print Setup ═══ The Print Setup dialog box lets you select the Printer and Job Properties. The Job Properties dialog box allows printer driver-dependent options to be changed. ═══ 7.1.9. Print Options ═══ The displayed image can be printed in three ways: 1) best fit for the page, 2) fit for the full page, or 3) scaled by a user-selected factor. Best Fit scales the image for maximum fit on a printed page while maintaining the image's aspect ratio. Fit for Full Page scales the image such that it fits the entire page. The Scale option scales the printed image's width or height by an integer factor that is selected by the user. ═══ 7.1.10. Exit ═══ Exit from PMJPEG. ═══ 7.2. Edit Menu ═══ The Edit menu includes commands that enable you to transfer images to and from the clipboard, change the color components of an image, and to manipulate the image. o Copy o Paste o Crop o HSV Adjustment o Color Balance o Contrast Enhancement o Grayscale o Gamma Correction o Map To System Colors o Rotate o Flip Horizontal o Flip Vertical o Resize ═══ 7.2.1. Copy ═══ Copy the entire image to the clipboard. ═══ 7.2.2. Paste ═══ Paste an image from the clipboard. ═══ 7.2.3. Crop ═══ If a region of the image is selected (see Selecting a Region to Crop), keep that region and discard the image outside of the selected region. ═══ 7.2.4. HSV Adjustment ═══ Use the scroll bars to adjust the amount of hue, saturation, and value/brightness in an image. A value of 0 on the scroll bar means that there is no change in the corresponding color component. When the value is increased or decreased, the color component is increased or decreased, respectively. ═══ 7.2.5. Color Balance ═══ Use the scroll bars to adjust the amount of red, green, and blue in an image. A value of 0 on the scroll bar means that there is no change in the corresponding color component. When the value is increased or decreased, the color component is increased or decreased, respectively. ═══ 7.2.6. Contrast Enhancement ═══ Use the scroll bar to adjust the amount of contrast in an image. A value of 0 on the scroll bar means that there is no change in the contrast. When the value is increased or decreased, the contrast is increased or decreased, respectively. ═══ 7.2.7. Grayscale ═══ Convert a color image into a grayscale one. ═══ 7.2.8. Gamma Correction ═══ Use the scroll bar to adjust the amount of gamma. A value of 1.0 on the scroll bar means that there is no change in the image. In general, increasing the gamma makes the image lighter and decreasing it makes the image darker. A gamma of 2.2 is a commonly used value. ═══ 7.2.9. Map To System Colors ═══ Converts the displayed image to an image that has a 256-color palette containing the system colors of the OS/2 desktop. Use this option to generate an image that can be used as a 256-color OS/2 desktop-background image. ═══ 7.2.10. Rotate ═══ Rotate the image clockwise by 90 degrees. ═══ 7.2.11. Flip Horizontal ═══ Flip the image around the vertical axis. ═══ 7.2.12. Flip Vertical ═══ Flip the image around the horizontal axis. ═══ 7.2.13. Resize ═══ Change the spatial resolution of the displayed image. Common sizes such as 640x680, 800x600, 1024x768, and 1280x1024 can be easily selected. The Maximize Fit on Desktop option will resize the image into the largest possible window that will fit on the desktop while keeping the aspect ratio, the ratio between the original width and height. Also, a custom size can be manually entered. If Keep Aspect Ratio is enabled, only one dimension needs to be entered because the other one is automatically changed to maintain the aspect ratio. ═══ 7.3. Options Menu ═══ The Options menu includes commands that let you determine how other commands operate. The settings for the options can be saved with the Save All Options command. o Stretch to Fit Window o Maximum Color Depth o Display Old Image during Load o Move Window after Load o Auto-Refresh o JPEG Options o Slideshow Options ═══ 7.3.1. Stretch to Fit Window ═══ When this option is checked, the scrollbars for the PMJPEG window are turned off and the image is stretched to the dimensions of the client area of the PMJPEG window. This option does not permanently change the resolution of the image. If you save the image, the original image is saved, not the stretched one. ═══ 7.3.2. Maximum Color Depth ═══ When you load an image that has more colors than the Maximum Color Depth setting, PMJPEG will reduce the number of colors to the Maximum Color Depth setting before displaying the image. If you are viewing images, you should set this option to the number of colors supported by your display driver. If you are converting images from one file format to another, you should set it to 16.7 million colors. ═══ 7.3.3. Display Old Image during Load ═══ If this option is checked, you can continue viewing the currently displayed image while another image is being loaded. However, this option will use more memory because PMJPEG has to maintain two images. Consequently, it may slow down the loading of the next image if PMJPEG runs out of physical memory and must use slower virtual memory. ═══ 7.3.4. Move Image after Load ═══ If this option is checked, the PMJPEG window is moved to the upper left-hand corner of the desktop after an image is loaded. ═══ 7.3.5. Auto-Refresh ═══ The purpose of this option is to provide a temporary solution to a bug in the 256 color drivers. This bug is evident when the area of the image under a drop-down menu or under a dialog box is not properly redrawn after the drop-down menu or the dialog, respectively, is closed. If this menu item is checked, PMJPEG will automatically refresh the image when it is necessary. ═══ 7.3.6. JPEG Options ═══ 2-pass(Heckbert) quantization produces better looking output than 1-pass quantization and it is slower. Also, 2-pass quantization uses more memory so it may be even slower because PMJPEG will swap to hard disk when it runs out of virtual memory. The output of 1-pass generally looks more grainy. Dithering uses available colors in a palette to simulate additional colors. The dithering method that PMJPEG uses is called Floyd-Steinberg Dithering. Dithering is useful when quantizing to 256 colors or less but it is not needed for a true-color (24-bit) display. You may want to turn off dithering since it sometimes causes a grainy output image. The Quality Factor, an integer between 0 and 100 inclusive, determines the tradeoff between the output file size and the output image quality. If you choose a high quality factor, the image quality will be high but the file size will be large. A lower quality setting will yield a smaller file at a cost of lower fidelity. Since the JPEG algorithm is lossy, a quality factor of 100 will not give you a losslessly compressed image. The Smoothing Factor, also an integer between 0 and 100 inclusive, determines the degree of smoothing to apply to an image before compressing that image with JPEG. The higher you set the factor, the higher the degree of smoothing that is applied. A smoothing factor of 0 means that no smoothing is performed. Smoothing removes noise introduced when an image is dithered, and, in turn, smoothing produces a smaller JPEG file. It should be used for only dithered images, like photographic GIF pictures. Generally, a factor between 10 and 50 removes the dithering noise from an image. Entropy Optimization produces a smaller JPEG file but it takes more time to encode the image. If PMJPEG runs out of virtual memory while it is decoding/encoding JPEG files, it will use temporary files that are created in the specified path. ═══ 7.3.7. Slideshow Options ═══ When a slideshow is running, the Cycle Slideshow option determines whether or not a list of images are continuously displayed in a cycle. If this option is on, the slideshow returns back to the first picture after the last one is displayed and continues to display all the images in a selected list until you abort the slideshow. The Slide Advancement options determine how to advance to the next image in a slideshow. In Manual mode, PMJPEG will wait until you click with the right mouse button before advancing to the next picture. In Automatic mode, there will be a user-selected time delay before the next picture is loaded. To advance to the next picture before the delay has elapsed, click on the window with the right mouse button. The Delay can be set to a value between 0 and 999 seconds. The Buffer Image Formats options allow buffering of selected image formats during a cyclic slideshow. If a type is selected, all images of that type are stored in memory after they are loaded and decompressed, and they will not be loaded/decompressed the next time they are displayed. This feature must be used in conjunction with the Cycle Slideshow option. Buffering images can use a lot of memory; if you don't have much physical memory, be certain that there is enough disk space on OS/2's swap drive to handle this memory usage. ═══ 7.3.8. Progress Options ═══ For time-consuming tasks like loading, saving, batch compressing, and mapping to system colors, PMJPEG displays a percentage that indicates how much of the task has been completed. The progress can be displayed in either a dialog box or the title bar of the PMJPEG window. ═══ 8. Selecting a Region to Crop ═══ To select a region of the image, click on the image with the left mouse button. While holding down that button, move your mouse until the rectangle surrounds the desired region, and then release the mouse button. The dimensions of the selected region are displayed in the center of the indicated region. ═══ 9. How to Register ═══ If you use PMJPEG for more than 14 days, you are expected to register PMJPEG. When you register, you will receive the latest version of PMJPEG, a user manual, and a collection of JPEG images (we will put as many as we can fit on 2 720k 3 1/2" floppies, on 1 1.44M 3 1/2" floppy, or on 4 360k 5 1/4" floppies). Also, the registered version does not have the reminder-to-register screen at the start. The registration fee is only $20. MA residents, add 5% sales tax to the registration fee. US residents, add $4 for shipping and handling; non-US residents, add $8 for shipping and handling. If you want PMJPEG e-mailed to your account instead of having it physically mailed to you, there is no extra shipping charge. Updates are free but the shipping charge described above applies to updates. Users who register PMJPEG and provide an e-mail address will automatically receive updates via e-mail. For e-mail registrations, you need to use a program called "uudecode" to decode the uuencoded file that we e-mail to you. For your information, a uuencoded file is a binary file that is converted to text by a program called "uuencode". If your mail system rejects large messages, we will split the uuencoded file into smaller parts before mailing the parts to you, and you will need to edit the messages with a text editor before you can decode them. Compuserve, for example, does not permit large e-mail messages. Also, the uuencoded file is rather large; it is approximately 300k for PMJPEG v.1.4. Compuserve users may find it less expensive to receive PMJPEG via U.S. Mail. Registrations with the incorrect fee, non-US currency, or drawn on a non-US bank will be returned. To register, complete the order form and send a check in US funds drawn on a US bank to: Norman Yee 58 Chandler St. Boston, MA 02116 Registration of PMJPEG is based on "personal usage." Corporate or organizational users must register all copies used on an individual basis; a specific person (name) must be explicitly assigned to each registrant who will be provided with a personalized copy of PMJPEG. Registration grants a specific person (not an organization or corporate entity) the right to use PMJPEG. Although we will try to mail your copy of PMJPEG 1-3 weeks after we receive your registration, please allow up to 4-6 weeks for delivery. ═══ 10. Reporting Bugs ═══ If you find a bug in PMJPEG, we would appreciate it if you would inform us of the bug through one of our e-mail accounts: Norman Yee nyee@osiris.ee.tufts.edu Ken Yee kenyee@ksr.com When you send us a bug report, include a description of the procedure for reproducing the bug and a description of your system configuration(hardware and software). ═══ 11. License Agreement (applicable to registered users) ═══ You are licensed to single-copy use of PMJPEG; this means that you can install your registered version of PMJPEG simultaneously on one computer at work, one computer at home, and one portable computer, if only one copy is in use by the registered individual at a time. You may make copies of the registered PMJPEG disk as necessary for normal backup purposes; you agree not to make any copies of the printed PMJPEG manual or the registered version of PMJPEG for others. ═══ 12. Disclaimer ═══ The authors of this program accept no responsibility for damages that are caused by this program and make NO WARRANTY or representation, either express or implied, with respect to this software. This software is provided "AS IS," and you, its user, assume the entire risk when you use it. ═══ 13. Acknowledgments ═══ PMJPEG is based in part on the work of the Independent JPEG Group. TIFF support in PMJPEG is based in part on Sam Leffler's TIFF library. Windows is a trademark of Microsoft Corporation. OS/2 is a trademark of International Business Machines Corporation. The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated. GIF2JPG and Image Alchemy are trademarks of Handmade Software, Inc. WinJPEG is copyright (C) 1992, 1993, Norman Yee and Ken Yee. All rights reserved. PMJPEG is copyright (C) 1993, Norman Yee and Ken Yee. All rights reserved. o Copyright Notice for Sam Leffler's TIFF Library ═══ 13.1. Copyright Notice for Sam Leffler's TIFF Library ═══ Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993 Sam Leffler Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics.